<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <div class="navbar-header">

            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">zblog</span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{{ url_for('main.index') }}">{{ blog_name }}</a>
        </div>
        {% with messages = get_flashed_messages() %}
            {% if messages %}
                {% for message in messages %}
                    <li id="msg" class="center-block" style="list-style-type: none">
                        <a class="btn-navbar btn-warning affix">
                            <span class="glyphicon glyphicon-exclamation-sign"></span> {{ message }}
                        </a>
                    </li>
                {% endfor %}
            {% endif %}
        {% endwith %}
        <div id="navbar" class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <li><a href="{{ url_for('main.index') }}">首页</a></li>
                <li class="active"><a href="{{ url_for('admin.index') }}">后台</a></li>
            </ul>

            {% if g.user.is_authenticated() %}
                <div class="pull-right  btn-group ">
                    <button class="btn btn-link dropdown-toggle navbar-btn" data-toggle="dropdown">
                        <i class="glyphicon glyphicon-user red"></i><span class="hidden-sm hidden-xs"> 管理员</span>
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu ">
                        <li><a href="{{ url_for('user.usereditinfo') }}">
                            <i class="glyphicon glyphicon-wrench "></i> 个人设置</a></li>
                        <li class="divider"></li>
                        <li><a href="{{ url_for('user.logout') }}">
                            <i class="glyphicon glyphicon-log-out "></i> 退出系统</a></li>
                    </ul>
                </div>
            {% else %}
                <div class="navbar-right btn-group ">
                    <a href="{{ url_for('user.register') }}" class="btn btn-link navbar-btn">注册</a>
                    <a href="{{ url_for('user.login') }}" class="btn btn-link navbar-btn">登陆</a>
                </div>
            {% endif %}
        </div>
    </div>
</nav>
<br/>
<br/>
<br/>


